data=combo;
datasize=size(data);
maindata=data;
count=0;
%for j=1:datasize(2)-1
%a(j)=1;
%end

a=[1 1 10 10 5 5 7];

a

for i=1:datasize(1),
for j=1:datasize(2)-1,
    newSet(i,j)=maindata(i,j+1)*maindata(i,1) ;
end
end

theta=0.0005;
k=0;
while k~=70
        k=k+1;
        
        ypoints=zeros(1,datasize(2)-1);
        for i=1:datasize(1)
            val=dot(a,newSet(i,:));
            if val<0
                ypoints=ypoints - newSet(i,:);
            end
        end    
        a= a- (1.0/k).* ypoints;
        %if (1.0/k).*ypoints <theta
           % break;
        %end
end

a

tot=0;
for i=1:datasize(1)
    val = dot(a,newSet(i,:));
    if val<0
        cur=-1;    
    else
        cur=1;
    end
    cur;
    if cur==maindata(i,1)
        tot=tot+1;
    end
end
tot/datasize(1)